package com.ruoyi.baseData.controller;


import com.ruoyi.baseData.domain.dto.ProceduresDto;
import com.ruoyi.baseData.domain.dto.WoProceduresDto;
import com.ruoyi.baseData.service.ProceduresService;
import com.ruoyi.common.core.domain.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/procedures")
public class ProceduresController {

    @Autowired
    ProceduresService proceduresService;

    @PostMapping("/getProceduresByPage")
    public R export(@RequestBody ProceduresDto materialDto)
    {
        return R.ok(proceduresService.getProceduresByPage(materialDto));
    }

    @PostMapping("/addProcedures")
    public R addTest(@RequestBody ProceduresDto materialDto){
        proceduresService.addProcedures(materialDto);
        return R.ok("添加成功");
    }

    @PostMapping("/delProcedures")
    public R delTest(@RequestBody ProceduresDto materialDto){
        proceduresService.delProcedures(materialDto);
        return R.ok("删除成功");
    }

    @PostMapping("/updateProcedures")
    public R updateTest(@RequestBody ProceduresDto materialDto){
        proceduresService.updateProcedures(materialDto);
        return R.ok("锁定成功");
    }


    @PostMapping("/getEquipAndProcessByWo")
    public R updateTest(@RequestBody WoProceduresDto materialDto){
//        proceduresService.getEquipAndProcessByWo(materialDto);
        return R.ok(proceduresService.getEquipAndProcessByWo(materialDto));
    }



}
